<template>
	<view class="content">
		<view class="pddingbox">
			<view class="topBox">
				<view class="search f16">
					<input type="text" v-model="value" class="inputBox f16" placeholder="输入手机号或服务地址" />
					<icon class="iconfont iconfangdajing" type="" @tap="search()"></icon>
				</view>
			</view>
		</view>
		
		<view class="list">
			<view class="item vailCard" @tap="jump(item.svcRecordId)" v-for="(item,index) in list" :key="index">
				<view class="row">
					<view class="right">
						<icon class="iconfont iconshijian hascolor" type="" />
						{{item.svcDate?item.svcDate.split('.')[0].split(':')[0]:'' }}:{{item.svcDate?item.svcDate.split('.')[0].split(':')[1]:''}}
						</view>
					<view class="left left_txt">
						{{item.svcName}}
					</view>
				</view>
				<view  class="row">
					<view class="right txt">{{item.liaison}}</view>
					<view class="left">{{item.liaisonPhone}}</view>
				</view>
				<view class="row address">
					{{item.svcPosition}}
				</view>
			</view>
			<view class="nullbox" v-if="list.length == 0">
				没有服务记录
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data() {
			return {
				value:"",
				address:"",
				list:[]
			}
		},
		mounted(){
		},
		onLoad() {
		},
		onShow() {
			this.getServerList()
		},
		methods: {
			search(){
				this.getServerList()
			},
			jump(s){
				uni.navigateTo({
					url:"./serverDetails?svcRecordId="+s
				})
			},
			getServerList(){
				this.postApi('listByUser','GET',
				{
					data:{keyword:this.value},
					loading:true
				}).then(res=>{
					console.log('res',res)
					this.list = res.data
				})
			}
		}
	}
</script>

<style lang="less">
	@import '@/common/common.less';
	.content{
		display: flex;
		flex-direction: column;
		position: relative;
		height: 100%;
		background-color: #f2f2f2;
		.pddingbox{
			position: fixed;
			top: 0;
			z-index: 2;
			background-color: #f2f2f2;
			width: 100%;
		}
		.topBox {
			border-radius: 20rpx;
			height: 110rpx;
			margin: 0 auto;
			background-color: @primary-color;
			display: flex;
			align-items: center;
			justify-content: space-between;
			vertical-align: middle;
			margin-bottom: 13rpx;
			width: 95%;
			.search {
				background: #fff;
				display: flex;
				flex-direction:row ;
				height: 75rpx;
				line-height: 75rpx;
				align-items: center;
				border-radius: 20rpx;
				width: 90%;
				margin: 0 auto;
				.iconfont {
					width: 50rpx;
					color: #cccccc;
					font-size: 18px;
				}
				.inputBox{
					width: 80%;
					padding-left:20rpx ;
				}
			}
		}
		.list{
			height:calc( 100% - 110rpx);
			padding-top: 120rpx;
			width: 95%;
			margin: 0 auto;
			.nullbox{
				text-align: center;
				margin-top:200rpx;
				color: #555555;
			}
			.item{
				padding: 22rpx 45rpx 32rpx 31rpx;
				background-color: #ffffff;
				margin: 0 auto 17rpx auto;
				border: 1rpx solid #cdcdcd;
				border-radius: 10rpx;
			}
			.vailCard{
				margin-top: 17rpx;
				background-color: #FFFFFF;
				border-radius: 10rpx;
				padding: 23rpx 30rpx;
				color: #555555;
				.row{
					position: relative;
					display: flex;
					justify-content: space-between;
					margin-bottom: 22rpx;
					.right{
						.iconfont{
							margin-right: 30rpx;
						}
						.hascolor{
							color: @primary-color;
						}
					}
					.right.txt{
						margin-left: 60rpx;
					}
					.right.detil{
						color: @primary-color;
						margin-left: 60rpx;
					}
					.left_txt{
						color: @primary-color;
					}
				}
				.row.address{
					margin-left: 60rpx;
				}
				.showButton{
					height: 88rpx;
					line-height: 88rpx;
					background-color: @primary-color;
					text-align: center;
					font-weight: bold;
					color: #FFFFFF;
					border-radius: 10rpx;
				}
				.ed{
					background-color: #aaaaaa;
				}
			}
		}
	}
</style>
